package com.xmy.cultivate.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.OrderApply;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.cultivate.entity.OrderDetail;
import com.xmy.cultivate.entity.views.ResTransaction;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单报名信息 服务类
 * </p>
 *
 * @author min
 * @since 2022-07-28
 */
public interface IOrderApplyService extends IService<OrderApply> {

    public abstract boolean saveTo(OrderApply orderApply) throws ParseException;

    public abstract boolean updateDate(OrderApply orderApply);

    public abstract boolean transferSchoolSave(OrderApply orderApply) throws ParseException;

    public abstract boolean batchTransferSchoolSave(OrderApply orderApply) throws ParseException;


    public abstract IPage<OrderApply> findAll(IPage<?> page, Wrapper wrapper);

    public abstract List<Map<String,Object>> orderArrears(Wrapper wrapper);

    /**
     * 收支明细
     * @param page
     * @param wrapper
     * @return
     */
    public abstract IPage<OrderApply> expensesAndReceipts(IPage<?> page, Wrapper wrapper);

    public abstract IPage<ResTransaction> transaction(IPage<?> page, Wrapper wrapper);

    public abstract IPage<OrderApply> affirmIncome(IPage<?> page,Wrapper wrapper);

    /**
     * 确认到帐
     * @param id
     * @param adminId 登陆人id
     * @param isSuper 是否超级管理员
     * @return
     */
    public abstract boolean confirmArrive(Long id,Long adminId,Integer isSuper);



    public abstract boolean financeConfirm(Long id,Long adminId,Integer isSuper);

    /**
     * 订单作废
     * @param id
     * @param adminId 登陆人id
     * @param isSuper 是否超级管理员
     * @return
     */
    public abstract boolean invalidate(Long id,Long adminId,Integer isSuper);

    public abstract boolean addDiscount(@RequestBody OrderDetail orderDetail);
}
